export default function getParamByKey(key: string) {
  const reg = new RegExp('(^|&?)' + key + '=([^&]*)(&|$)', 'i');
  const u = location.hash || location.search;
  const r = u.substr(1).match(reg);
  if (r !== null) return unescape(decodeURI(r[2]));
  return null;
}
